<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">

        <ul>
            <li v-for="item in book">{{item}}</li>
        </ul>
        <input type="button" value="修改" @click="handler">
    </div>
</body>
<script src="./vue.global.js"></script>
<script>

    //  一：vue3 的响应式原理使用 了proxy
    //      1.proxy 比object.defineProperty() 快10 倍
    //      2.proxy 解决了数组下标不是响应式的问题




    const {createApp} =Vue
    let app = createApp({
        data(){
            return{
                book:["荷塘月色","面朝大海"]
            }
        },
        methods:{
            handler(){
                console.log(this)  // 是个代理对象 proxy
                this.book[0] = "宇宙形式"
            }
        }
    })
    app.mount("#app")
</script> 
</html>